//vuex 模块化开发
import {resSearchInfo} from "@/api";

const state={
    searchList:{},
}
const actions={
    async searchList(context,params){
        const result=await resSearchInfo(params);
        if(result.code==200){
            context.commit('SEARCHLIST',result.data)
        }
    }
}
const mutations={
    SEARCHLIST(state,value){
        state.searchList=value;
    }
}
const getters={
    goodsList(state){
        return state.searchList.goodsList||[];
    },
    attrsList(state){
        return state.searchList.attrsList||[];
    },
    trademarkList(state){
        return state.searchList.trademarkList||[];
    },
    total(state){
        return state.searchList.total;
    }
}
export default {
    state,
    actions,
    mutations,
    getters
}